/*
 * LED.cpp
 *
 *  Created on: Jan 29, 2010
 *      Author: fmason
 */
#include "LED.h"

void LED::setup()
{
	Wire.begin(); // set up I2C
	Wire.beginTransmission( LED_ADDRESS );// join I2C bus, to BlinkM
	Wire.send( STOP_SCRIPT ); // stop the script
	Wire.endTransmission();//finish command
}

void LED::setColor( int red, int blue, int green )
{
	Wire.beginTransmission( LED_ADDRESS );// join I2C bus, to BlinkM
	Wire.send( SET_COLOR_WITHOUT_FADING );// set the colour without fading
	Wire.send( red );//set the color to red
	Wire.send( blue );
	Wire.send( green );
	Wire.endTransmission(); // finish command
}
